package com.dx.financehy.modules.business.mapper;

import com.dx.financehy.config.mp.EasyBaseMapper;
import com.dx.financehy.modules.business.domain.Business;
import com.dx.financehy.modules.business.domain.dto.EditBusinessDTO;
import com.dx.financehy.modules.system.domain.vo.BusinessVO;
import com.dx.financehy.modules.system.domain.vo.MainBusinessVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author: huang_jigao
 * @Title: BusinessMapper
 * @ProjectName: financehy
 * @Description:
 * @date: 2024-05-14 8:48
 */
@Mapper
public interface BusinessMapper extends EasyBaseMapper<Business> {

    /**
     * 获取商家列表
     *
     * @param userIds
     * @return
     */
    List<MainBusinessVO> getBusinessList(@Param("userIds") List<String> userIds);

    /**
     * 获取用户主营业务
     *
     * @param userId
     * @return
     */
    List<BusinessVO> getEditBusinessList(@Param("userId") String userId);

    /**
     * 首页获取用户主营业务
     *
     * @param userId
     * @return
     */
    List<BusinessVO> getBusinessHomePage(@Param("userId") String userId);

    int editBusiness(@Param("list") List<EditBusinessDTO.EditBusinessInternal> editBusinessInternals,
                     @Param("userId") String userId,
                     @Param("updateTime") Date updateTime);
}
